#!/usr/bin/env bash

NAME=realtek-r8125
VERSION=@PKGVER@

set -e

case "$1" in
    remove|upgrade|deconfigure)
        if [[ -n $(dkms status -m $NAME) ]]; then
            dkms remove -m $NAME -v $VERSION --all
        fi
        ;;

    failed-upgrade)
        ;;

    *)
        echo "prerm called with unknown argument $1" >&2
        exit 1
        ;;
esac

exit 0
